#include<iostream>
#include<cstdlib>
#include<cstring>
#include<vector>

using namespace std;

int insertion ( vector<double> &_arr);

int main ( int argc, char *argv[])
{
  int n = -1;
  cin >> n;
  vector<double> arr(n);
  for(vector<double>::iterator arr_iterator = arr.begin();
      arr_iterator != arr.end();
      ++arr_iterator)
      cin >> *arr_iterator;
  insertion(arr);
  cout << "A: ";
  for(vector<double>::iterator arr_iterator = arr.begin();
      arr_iterator != arr.end();
      ++arr_iterator)
      cout << *arr_iterator << " ";
  cout << endl;
  return 0;
}

int insertion ( vector<double> &_arr){
    for( int j = 1; j < _arr.size(); j++)
    {
	double key = _arr[j];
	int i = j-1;
	while (i >= 0 &&_arr[i] > key){
	    _arr[i+1] = _arr[i];
	    i=i-1;
	}
	_arr[i+1] = key;
    }
    return 0;

};
